<?php
class Application_Model_ReturnGoods extends Application_Model_DomainObject{
	
	protected $_id;
	
	protected $_storeItemId;   //仓库表id
	
	protected $_userId;       //用户表id
        
        protected $_productName;   //包裹名称

        protected $_orderNo;      //物流单号
        
        protected $_returnNote;    //退货备注
        
        protected $_state;         //状态：1代表处理中，2代表已处理
        
        protected $_isDelete;     //标记删除：0代表不删除，1代表删除
        
        protected $_readdres;     //退货地址
        
        protected $_renumber;     //退货单号
        
        protected $_refreight;     //退货运费
        
        protected $_currency;      //币种
        
         public function getuserinfo()
        {
            if($this->_userId)
            {
                return Application_Model_User::load($this->_userId);
            }
        }
        public static function getFilter($name,$state,$pagesize,$pageindex){
            $where=array(); 
            if($name != null){
                /*$user_where=array();
                $user_where[" nikename like "] = "%".$name."%";
                $userItem = Application_Model_User::getDao()->queryAll($user_where);
                if($userItem){
                    $userarrid = "";
                    foreach ($userItem as $uservalue) {
                        $userarrid.= $uservalue->id.",";
                    }
                    $where[$and." userid in "] = "(".$userarrid."0)";
                    $and = " or ";
                }*/
                $where["state"] = $state;
                $where[" and orderNo like "] = "%".$name."%";
                $where[" or productName like "] = "%".$name."%";
                
            }else{
                $where["state"] = $state;
            } 
            return Application_Model_ReturnGoods::getDao()->queryPage($where,'id desc',$pagesize,$pageindex); 
        }
      
  	
}